package com.examination.utils;

import java.util.List;

public class PageInfo<T> {
    private Integer totalPageNum = 0;//总页数
    private Integer curPage = 1;//当前页码
    private Integer pageSize = 10;//每页记录数
    private Integer countNum;//总记录数
    private Integer start = 0;//查询起始点
    //对象列表
    private List<?> objList;
    public PageInfo(Integer curPage,Integer pageSize){
        this.curPage = curPage;
        this.pageSize = pageSize;
    }

    public Integer getCountNum() {
        return countNum;
    }

    public void setCountNum(Integer countNum) {
        this.countNum = countNum;
        this.totalPageNum =  (this.countNum +this.pageSize - 1) / this.pageSize;
    }

    public List<?> getObjList() {
        return objList;
    }

    public void setObjList(List<?> objList) {
        this.objList = objList;
    }

    public Integer getTotalPageNum() {
        return totalPageNum;
    }

    public void setTotalPageNum(Integer totalPageNum) {
        this.totalPageNum = totalPageNum;
    }

    public Integer getCurPage() {
        return curPage;
    }

    public void setCurPage(Integer curPage) {
        this.curPage = curPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getStart() {
        this.start = (this.curPage - 1) * this.pageSize;
        return start;
    }

    public void setStart(Integer start) {
        this.start = start;
    }
}
